﻿<!--
    
/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A
 * copy of the license can be found at http://go.microsoft.com/fwlink/?LinkID=131993. If
 * you cannot locate the Microsoft Public License, please send an email to
 * mixon@microsoft.com. By using this source code in any fashion, you are agreeing to
 * be bound by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 *
 * ***************************************************************************/
    
-->
<UserControl x:Class="MIXOnline.Descry.Timeline"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:t="clr-namespace:MIXOnline.Descry"
    >
    <Grid x:Name="LayoutRoot" Background="#FF1D1D1D">

        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid.Resources>
            
            <t:AvatarConverter x:Key="AvatarImageConverter"/>
            
            <DataTemplate x:Key="EntryItemTemplate">
                <Grid  >
                    <Grid.RenderTransform>
                        <TranslateTransform/>
                    </Grid.RenderTransform>
                    <Grid >
                        <StackPanel x:Name="EntryItem" Background="#01FFFFFF" Orientation="Horizontal" Width="50" HorizontalAlignment="Left" Cursor="Arrow"  MouseEnter="entryItem_MouseEnter">
                            <Image x:Name="avatar" Source="{Binding Converter={StaticResource AvatarImageConverter}, ConverterParameter='small', Mode=OneWay, Path=User.NickName}" Width="22" Height="22" Margin="2,2,4,2"/>
                            <Grid Width="22" Height="22" x:Name="service" Background="#01FFFFFF">
                                <Rectangle x:Name="rect" RadiusX="2" RadiusY="2" Fill="#FFFFFFFF" Stroke="#FFDBD9D9"/>
                                <Image x:Name="image" Source="{Binding Path=Service.IconUrl}" Width="16" Height="16" Margin="3,3,3,3"/>
                            </Grid>
                        </StackPanel>
                    </Grid>
                </Grid>
            </DataTemplate>
        </Grid.Resources>

        <Grid Grid.Row="0">

            <Grid.RowDefinitions>
                <RowDefinition Height="60"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Grid  Grid.Row="0" x:Name="ScaleContainer">
                <t:ScalePanel x:Name="ScalePanel0" >
                    <t:ScalePanel.RenderTransform>
                        <TranslateTransform/>
                    </t:ScalePanel.RenderTransform>
                </t:ScalePanel>
                <t:ScalePanel x:Name="ScalePanel1" >
                    <t:ScalePanel.RenderTransform>
                        <TranslateTransform X="0"/>
                    </t:ScalePanel.RenderTransform>
                </t:ScalePanel>
                <t:ScalePanel x:Name="ScalePanel2" >
                    <t:ScalePanel.RenderTransform>
                        <TranslateTransform/>
                    </t:ScalePanel.RenderTransform>
                </t:ScalePanel>
                
                <!-- for debugging. hidden in release-->
                <TextBlock x:Name="textBoxCurrentTimeStamp" Text="Time Stamp" Width="150" HorizontalAlignment="Center" VerticalAlignment="Bottom" Style="{StaticResource textBlockStyle}" Height="18" Visibility="Collapsed"/>
                
            </Grid>

            <Grid Grid.Row="1" x:Name="SurfaceContainer" Cursor="Hand" >
                <t:VirtualizedTimelineItemsControl x:Name="virtualizedTimelineItemsControl" ItemTemplate="{StaticResource EntryItemTemplate}"/>
            </Grid>

            <!-- for debugging. hidden in release-->
            <Grid Grid.Row="1" Visibility="Collapsed">
                <Canvas Width="1" HorizontalAlignment="Center" Background="#FF262626"/>
            </Grid>

            <Canvas>
                <t:EntryItemPopup x:Name="entryItemPopup" Visibility="Collapsed" Canvas.ZIndex="9999"/>
            </Canvas>
            
            

        </Grid>
    </Grid>
</UserControl>
